Skip to content

Auto versioning#1348

Merged
Azgaar merged 2 commits intoauto-versioningfrom
copilot/sub-pr-1344
Mar 7, 2026
Merged

Auto versioning#1348
Azgaar merged 2 commits intoauto-versioningfrom
copilot/sub-pr-1344

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

Automates semver bumping and cache-busting on every PR merge to master via a GitHub Actions workflow + Node scripts.

Scripts

  • scripts/bump-version.js — bumps VERSION in public/versioning.js, package.json, and package-lock.json; refreshes ?v= hashes in src/index.html (static imports) and across public/**/*.js (dynamic import() calls) for any files changed in the PR
  • scripts/detect-bump-type.js — calls GitHub Models API (gpt-4o-mini) with the PR diff to determine patch / minor / major; falls back to patch on any error

Workflow (.github/workflows/bump-version.yml)

Triggers on pull_request closed+merged into master:

  1. Checks out master branch explicitly (avoids detached PR merge ref so git push works)
  2. Generates PR diff → AI-detects bump type → extracts base version from HEAD~1
  3. Runs bump-version.js; skips version increment if the developer already bumped manually
  4. Stages public/versioning.js, package.json, package-lock.json, src/index.html, and public/ (for dynamic-import hash changes), then commits and pushes via RELEASE_BOT_TOKEN (so the push triggers deploy.yml)

public/versioning.js

  • Refactored inline <li> items into a latestPublicChanges array
  • Fixed branch reference: mainmaster
  • Added note that bumping is now automated

Type of change

  • Bug fix
  • New feature
  • Refactoring / style
  • Documentation update / chore
  • Other (please describe)

Versioning

  • Version is updated
  • Changed files hash is updated

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI mentioned this pull request Mar 7, 2026
7 tasks
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add auto versioning functionality Auto versioning Mar 7, 2026
@Azgaar Azgaar marked this pull request as ready for review March 7, 2026 17:03
Copilot AI review requested due to automatic review settings March 7, 2026 17:03
@Azgaar Azgaar merged commit b1dbac0 into auto-versioning Mar 7, 2026
@Azgaar Azgaar deleted the copilot/sub-pr-1344 branch March 7, 2026 17:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the post-merge version-bump workflow to ensure it checks out the base branch (so pushes work) and stages additional files that may be modified by cache-busting updates.

Changes:

  • Check out the PR base branch ref (instead of the detached PR merge ref) to allow git push without extra arguments.
  • Stage public/ so any public/**/*.js dynamic-import hash refreshes are included in the bump commit.

Comment on lines +22 to 26
# Check out the base branch (master) so we are on a real branch, not
# a detached PR merge ref, which makes git push work without arguments.
ref: ${{ github.event.pull_request.base.ref }}
# fetch-depth 2 so HEAD~1 resolves to the pre-merge master commit
fetch-depth: 2
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking out the base branch ref is fine, but the workflow’s later use of HEAD~1 assumes the merge added exactly one commit to master (squash merge or a merge commit). If the repo ever uses “Rebase and merge” (multiple commits added), HEAD~1 will point to another PR commit and the generated diff / base-version extraction will be wrong. Consider computing the pre-merge base SHA from the PR payload (e.g., github.event.pull_request.base.sha) and diffing that against the post-merge tip, or otherwise handling rebase merges explicitly.

Copilot uses AI. Check for mistakes.
# Stage versioning files + any public/**/*.js whose dynamic import
# hashes may have been refreshed by updatePublicJsDynamicImportHashes
git add public/versioning.js package.json package-lock.json src/index.html
git add public/ 2>/dev/null || true
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git add public/ 2>/dev/null || true suppresses both stderr and failures from git add, which can mask real problems (e.g., a pathspec issue or permission error) and lead to silently skipping expected staged changes. Prefer an explicit existence check for public/ (or a more specific path/glob) and let git add fail if something is unexpectedly wrong.

Suggested change
git add public/ 2>/dev/null || true
if [ -d public ]; then
git add public/
fi

Copilot uses AI. Check for mistakes.
Azgaar added a commit that referenced this pull request Mar 7, 2026
* feat: implement version bumping script and pre-push hook

* chore: bump version to 1.113.5

* chore: bump version to 1.113.6

* chore: bump version to 1.113.7

* chore: bump version to 1.113.8

* chore: bump version to 1.113.9

* chore: bump version to 1.113.10

* chore: bump version to 1.113.3 and update versioning process

* chore: enhance version bump process with base version check

* Update .github/workflows/bump-version.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .github/workflows/bump-version.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: sync package-lock.json version fields during automated version bump (#1345)

* Initial plan

* fix: update package-lock.json version fields during version bump

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

* Fix branch name in versioning.js comment: 'main' → 'master' (#1346)

* Initial plan

* fix: update branch name in versioning.js comment from 'main' to 'master'

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

* Extend bump-version.js to update ?v= cache-busting hashes in public/**/*.js dynamic imports (#1347)

* Initial plan

* feat: extend bump-version.js to update ?v= hashes in public/**/*.js dynamic imports

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

* chore: merge base branch changes (package-lock.json sync, RELEASE_BOT_TOKEN, node 24.x, comment fix)

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

* Update scripts/bump-version.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update scripts/bump-version.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
Co-authored-by: Azgaar <maxganiev@yandex.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: streamline dynamic import hash updates for public JS files

* refactor: enhance version bump detection using AI analysis of PR diffs

* Auto versioning (#1348)

* Initial plan

* fix: add ref to checkout step and stage public/**/*.js in bump workflow

Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants